package assignment;
import java.util.*;

public class Fibonacci
{
public static void main(String[] args) 
{
		int number[]={0,1,1,2,3,7}; 
		int a=number.length;
		System.out.println("Given List: ");
		for(int i=0;i<a;i++)
		{
			System.out.println(" " +number[i]);
		}
		if(number.length==1)
		{
			System.out.println("Yes Fibonnaci " +number[0]);
		}
		if(number.length==2)
		{
			System.out.println("Yes Fibonnaci " +number[0] +","+number[1]);
		}
		else
		{
	     int n1=number[0], n2=number[1];
	    int n3=0;
	    boolean isFibonacci=true;
                for(int i=2; i<number.length; i++)
                {
                   n3=number[i-1]+number[i-2];
                   
                   if(n3==number[i])
                   {
                	   continue;
                   }
                   else
                   {
                	   isFibonacci=false; 
                	   break;
                   }
                   
                }
                
                System.out.println("The Given series is Fibonacci");
		}         
	}
           

}